<template>
  <div class="userRecord">
    <div class="recordMain">
      <el-row :span="24" class="projects" v-for="item in comlist">
        <el-col :span="24">
          <div>
            <p>来源：{{item.sourceUser}}</p>
            <p class="gray">时间：{{formatDateDT(new Date(item.transTime),'yyyy-MM-dd hh:mm')}}</p>
          </div>
          <div class="projectContent"></div>
          <div class="projectRight">
            <p class="gray">{{item.transType}}</p>
            <p class="red">￥{{(item.transAmt-0).toFixed(2)}}</p>
          </div>
        </el-col>
      </el-row>
    </div>
    <div class="userFoot">
      <el-row :span="24">
        <el-col :span="24">没有更多记录了...</el-col>
      </el-row>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  export default {
    created () {
          //  查询佣金记录
      this.$http.post('http://218.104.153.143:8089/numberone-auth/userAccountLog/acountLogList.shtml', {pageSize: 100, pageNow: 1, token: this.$store.state.token}, {
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        emulateJSON: true
      }).then((data) => {
        this.comlist = data.body.accountLogList.records
      }, (ne) => {
        this.$message({
          message: '网络错误',
          type: 'error',
          duration: 1000,
          showClose: false
        })
      })
    },
    data () {
      return {
        comlist: [],
        params: {
          pageSize: 50,
          pageNow: 0
        },
        datas: {

        }
      }
    },
    methods: {
      formatDateDT (date, fmt) {
        var o = {
          'M+': date.getMonth() + 1, // 月份
          'd+': date.getDate(), // 日
          'h+': date.getHours(), // 小时
          'm+': date.getMinutes(), // 分
          's+': date.getSeconds(), // 秒
          'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
          'S': date.getMilliseconds() // 毫秒
        }
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
        for (var k in o) { if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) }
        return fmt
      }
    }
  }
</script>

<style lang="scss" type="stylesheet/scss">
  .userRecord{
  background-color:#f5f3f3;
    height: 615px;
    font-size: 14px;
    .recordMain{
      background-color:#fff;
      .projects{
      padding:0 15px;
      border-bottom: 1px solid #cec8c8;
        >.el-col-24{
           padding-top: 10px;
           text-align: left;
           height: 80px;
           line-height: 30px;
           display:flex;
          .projectContent{
            flex:1;
          }
          .projectRight{
            text-align: right;
          }
          .red{
            color: red;
            font-weight: bold;
            font-size: 16px;
          }
          .gray{
            color: gray;
          }
          }
      }
    }
  .userFoot{
  .el-col-24{
    padding:20px 0;
    color: gray;
  }
  }
  }

</style>
